package cn.zc.mapper;

import cn.zc.entity.LateTimeCource;
import cn.zc.entity.TimeVo;
import cn.zc.entity.User;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.*;

import java.util.List;
import java.util.Map;

@Mapper
public interface AdminMapper extends BaseMapper<User> {
    @Select("SELECT * FROM students where type=1")
    List<User> getAdminInfo();

    @Update("update period_time set start_time = #{start_time}, end_time = #{end_time} where period = #{period}")
    void setTime(TimeVo timeVo);
    @Select("select * from period_time where period = #{period}")
    TimeVo getOneTime(String period);
    @Delete("delete from login_logs")
    void clearLoginLog();
    @Update("update students set mypassword = #{mypassword}, name = #{name} where id = #{id}")
    void editAdmin(User admin);
    @Insert("insert into students(id, name, mypassword,type) values(#{id}, #{name}, #{mypassword},#{type})")
    void addAdmin(User admin);
    @Delete("delete from students where id = #{id}")
    void deleteAdmin(String id);
//    @Select("select Count(*) from student_violations where student_id=#{search}")
    int overtimelognum(String search,int type);
    @Select("select nowweek.week_num from nowweek")
    int getNowTime();
    @Update("update nowweek set week_num=#{week}")
    void setWeek(int week);
    @Select("select * from students where type=0")
    List<User> getUserInfo();
}
